package demo2;

import java.util.Arrays;

public class LeetCode283 {
        public void moveZeroes(int[] nums) {
            int n = nums.length;
            for(int left = -1, right = 0; right < n; right++) {
                if(nums[right] != 0) {
                    left++;
                    int tmp = nums[right];
                    nums[right] = nums[left];
                    nums[left] = tmp;
                }
            }
            System.out.println(Arrays.toString(nums));
        }
}
